<!DOCTYPE html>
<html>
<head>
  <title>QueryResult.java</title>
  <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
  <link rel='stylesheet' type='text/css' href='../../../../../coverage.css'/>
  <link rel='shortcut icon' type='image/png' href='../../../../../logo.png'/>
  <script type='text/javascript' src='../../../../../coverage.js'></script>
  <script type='text/javascript' src='../../../../../prettify.js'></script>
</head>
<body onload='prettyPrint()'>
  <table cellpadding='0' cellspacing='1'>
    <caption>igraph_client_java/src/main/java/com/taobao/igraph/client/model/QueryResult.java</caption>
    <tr>
      <td class='line'>1</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>package com.taobao.igraph.client.core.model;</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'></td><td>&nbsp;</td>
      <td><pre class='imports prettyprint' onclick='showHideLines(this)'><div>import java.io.Serializable;
import java.util.List;
</div><span>import ...</span></pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>6</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l6s0'>public class QueryResult implements Serializable{</pre></td>
    </tr>
    <tr>
      <td class='line'>7</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private static final long serialVersionUID = 1L;</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>9</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private List&lt;SingleQueryResult> results;</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'></td><td>&nbsp;</td>
      <td class='comment' onclick='showHideLines(this)'><div>    /**
     * 查询只有一个query时，调用此方法
     */</div><span>    /*...*/</span></td>
    </tr>
    <tr>
      <td class='line'>14</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public SingleQueryResult getSingleQueryResult() {</pre></td>
    </tr>
    <tr>
      <td class='line'>15</td><td class='count'>1</td>
      <td><pre class='prettyprint jmp'>        <span id='l15s0' title='Executions: 1' class='covered'>if (results == null</span> || <span id='l15s1' title='Executions: 1' class='covered'>results.size() != 1)</span> {</pre></td>
    </tr>
    <tr>
      <td class='line'>16</td><td class='count'>0</td>
      <td><pre class='prettyprint uncovered' id='l16s0'>            return null;</pre></td>
    </tr>
    <tr>
      <td class='line'>17</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        }</pre></td>
    </tr>
    <tr>
      <td class='line'>18</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l18s0'>        return results.get(0);</pre></td>
    </tr>
    <tr>
      <td class='line'>19</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'></td><td>&nbsp;</td>
      <td class='comment' onclick='showHideLines(this)'><div>    /**
     * 查询时有多个query时，调用此方法。
     * 
     * @return 多个query，要么所有的query结果按query顺序都返回，要么不返回。
     */</div><span>    /*...*/</span></td>
    </tr>
    <tr>
      <td class='line'>26</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public List&lt;SingleQueryResult> getAllQueryResult() {</pre></td>
    </tr>
    <tr>
      <td class='line'>27</td><td class='count'>0</td>
      <td><pre class='prettyprint uncovered' id='l27s0'>        return results;</pre></td>
    </tr>
    <tr>
      <td class='line'>28</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'></td><td>&nbsp;</td>
      <td class='comment' onclick='showHideLines(this)'><div>    /**
     * 查询特定query对应请求结果
     * 
     * @param index
     *            query的index
     * @return query对应的结果
     */</div><span>    /*...*/</span></td>
    </tr>
    <tr>
      <td class='line'>37</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public SingleQueryResult getQueryResult(int index) {</pre></td>
    </tr>
    <tr>
      <td class='line'>38</td><td class='count'>0</td>
      <td><pre class='prettyprint jmp'>        <span id='l38s0' title='Executions: 0' class='uncovered'>if (results == null</span> || <span id='l38s1' title='Executions: 0' class='uncovered'>index &lt; 0</span> || <span id='l38s2' title='Executions: 0' class='uncovered'>index >= results.size())</span> {</pre></td>
    </tr>
    <tr>
      <td class='line'>39</td><td class='count'>0</td>
      <td><pre class='prettyprint uncovered' id='l39s0'>            return null;</pre></td>
    </tr>
    <tr>
      <td class='line'>40</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        }</pre></td>
    </tr>
    <tr>
      <td class='line'>41</td><td class='count'>0</td>
      <td><pre class='prettyprint uncovered' id='l41s0'>        return results.get(index);</pre></td>
    </tr>
    <tr>
      <td class='line'>42</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>44</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public void setResults(List&lt;SingleQueryResult> results) {</pre></td>
    </tr>
    <tr>
      <td class='line'>45</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l45s0'>        this.results = results;</pre></td>
    </tr>
    <tr>
      <td class='line'>46</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l46s0'>    }</pre></td>
    </tr>
    <tr>
      <td class='line'>47</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>}</pre></td>
    </tr>
  </table>
</body>
</html>
